package com.example.springbootdemo.configuration;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName: RedissonConf
 * @Description:
 * @Author: TXW
 * @Date: 2025/1/13
 */

@Configuration
public class RedissonConf {

    @Bean
    public RedissonClient redissonClient(){
        Config config = new Config();
        config.useSingleServer().setAddress("redis://localhost:6379")
                .setDatabase(0);
        return Redisson.create(config);
    }
}
